package com.yanxml.spring.history.v3.demo3_import_selector.import_selector;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @Import 的类如果实现了ImportSelector注解. 其引入的就是其重写的selectImports方法对应的结果.
 */
public class MyImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
//        return new String[0];
        return new String[] {Logger.class.getName(), Cache.class.getName()};

        // 复杂写法可以进行if-else的判断
    }
}
